<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工人管理</title>
    <link href="../lib/layui/css/layui.css" rel="stylesheet" type="text/css" media="screen" />
    <script src="../lib/jquery-3.3.1.min.js" type="text/javascript" ></script>
    <script src="../lib/layui/layui.js" type="text/javascript" ></script>
    <script  src="../lib/xm-select.js" type="text/javascript" ></script>
    <script src="../js/cdfaceacs/workerMgr.js" type="text/javascript" ></script>
    <script type="text/html" id="barOperate">
        <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
    </script>
</head>
<body style="background-color:white;">
<div id="uploadDiv" style="display: none">
    <form class="layui-form" lay-filter="resource_form" id="resource_form" style="margin-top:5%">
        <input style="display: none" id="id" name="id">
        <div class="layui-form-item">
            <label class="layui-form-label" >人员姓名:</label>
            <div class="layui-input-inline">
                <input class="layui-input" name="name" id="userName" autocomplete="off" lay-verify="required"/>
            </div>
            <label class="layui-form-label" >人员编号:</label>
            <div class="layui-input-inline">
                <input class="layui-input" name="personCode" id="personCode" autocomplete="off" lay-verify="required"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" >参建单位:</label>
            <div class="layui-input-inline">
                <select name="unitId" id="unitId" lay-filter="unitId" lay-verify="required"></select>
            </div>
            <label class="layui-form-label" >所属班组:</label>
            <div class="layui-input-inline">
                <select name="teamId" id="teamId" lay-filter="teamId" lay-verify="required"></select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" >工种:</label>
            <div class="layui-input-inline">
                <select name="workTypeId" id="workTypeId" lay-filter="workTypeId" lay-verify="required"></select>
            </div>
            <label class="layui-form-label" >身份证号:</label>
            <div class="layui-input-inline">
                <input class="layui-input" name="certificateNum" id="certificateNum" autocomplete="off" lay-verify="required"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" >手机号:</label>
            <div class="layui-input-inline">
                <input class="layui-input" name="phone" id="phone" autocomplete="off" maxlength="11" placeholder="输入电话号码" lay-verify="required|phone"/>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">人脸信息</label>
                <div class="layui-upload" style="margin-left: 110px;">
                    <input type="hidden" name="faceData"  id="userFaceInfo"/>
                    <div class="layui-input-inline" >
                        <button type="button" class="layui-btn" id="uploadBtn" name="uploadBtn">上传人脸</button>
                        <p id="demoText2" class="mt10" ></p>
                    </div>
                    <div class="layui-upload-list">
                        <img class="layui-upload-img" alt="" style="width: 92px;height: 92px;margin: 0 10px 10px 0;  " id="demo1">
                    </div>
                </div>
                <input type="file" name="file" style="display:none" class="layui-btn" id="uploadImg">
            </div>
        </div>

        <div class='layui-input-block' style="margin-top: 20px;margin-left: 27%">
            <button class="layui-btn" id="upload_form" lay-submit="" lay-filter="upload_form">提交</button>
            <button class="layui-btn"  id="cancel_form">取消</button>
        </div>
    </form>
</div>

<div>
    <form class="layui-form" lay-filter="serch_form">
        <div class="layui-input-inline" >
            <input id="name" class="layui-input" autocomplete="off" placeholder="请输入人员姓名或编号">
        </div>
        <label>班组:</label>
        <div class="layui-input-inline">
            <select name="teamIdQuery" id="teamIdQuery" lay-filter="teamIdQuery" ></select>
        </div>
        <label>工种:</label>
        <div class="layui-input-inline">
            <select name="workTypeIdQuery" id="workTypeIdQuery" lay-filter="workTypeIdQuery" ></select>
        </div>
        <div class="layui-input-inline">
            <button class="layui-btn" lay-submit="" lay-filter="query_device" >查询</button>
        </div>
        <div class="layui-input-inline">
            <button class="layui-btn" type="button" onclick="addWorker()">添加人员</button>
            <button class="layui-btn" type="button" onclick="reload()">重置</button>
            <button class="layui-btn layui-btn-danger" lay-submit="" lay-filter="batchDelete" id="batchDelete">删除</button>
            <button class="layui-btn" lay-submit="" lay-filter="batchAuth" id="batchAuth">批量授权</button>
            <button class="layui-btn" lay-submit="" lay-filter="cancelBatchAuth" id="cancelBatchAuth">取消授权</button>
        </div>
    </form>
    <table id="workerTable" lay-filter="workerTable">
    </table>
</div>
<div id="batchAuthDiv" style="display: none">
    <form class="layui-form"  id="batchAuthForm" style="margin-top:1%">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">下发设备:</label>
                <div class="layui-input-inline">
                    <div id="issueDevice" style="width: 230%" class="xm-select-demo"></div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">权限模板:</label>
                <div class="layui-input-inline" style="width: 439px">
                    <select name="authTemplateId" id="authTemplateId" lay-filter="workTypeIdQuery" lay-verify="required"></select>
                </div>
            </div>
        </div>
        <div class='layui-input-block' >
            <button class="layui-btn" id="confirmAuthForm" lay-submit="" lay-filter="confirmAuthForm">提交</button>
            <button class="layui-btn" id="cancelAuthForm">取消</button>
        </div>
    </form>
</div>
</body>
</html>